<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="../css/public.css"/>
    <link rel="stylesheet"
          href="../css/themes/base/jquery.ui.all.css">
    <link rel="stylesheet" href="../js/demos.css">

    <script type="text/javascript"
            src="../js/jquery-1.7.2.js"></script>
    <script type="text/javascript"
            src="../js/jquery.ui.core.js"></script>
    <script type="text/javascript"
            src="../js/jquery.ui.widget.js"></script>
    <script type="text/javascript"
            src="../js/jquery.ui.position.js"></script>
    <script type="text/javascript"
            src="../js/jquery.ui.autocomplete.js"></script>
    <script type="text/javascript"
            src="../js/jquery.ui.datepicker.js"></script>
    <script type="text/javascript"
            src="../js/jquery.ui.datepicker-zh-CN.js"></script>
    <script src="../js/jquery.ui.button.js"></script>
    <link rel="stylesheet" href="../css/icons.css">
    <script src="../js/icons.js"></script>


    <title>Welcome
    </title>
</head>
<body>
<script type="text/javascript">
    $(function () {
        //old password
        $("#updatePassword_oldPassword").blur(function () {
            var pass = $(this).val();
            $.ajax({
                type: 'post',
                async:false,
                url: '${path}/user/changAction',
                data:{"password": pass} ,
                dataType:'json',
                success:function(result){
                    if(result == 1){
                        $("#erroldPassword").html(" √ ");
                        $("#erroldPassword").css("color","green");
                    }else{
                        $("#erroldPassword").html("× 输入有误");
                        $("#erroldPassword").css("color","red");
                    }
                },
                error:function(){
                    alert("验证原密码失败..")
                }
            });
        });

        //  new password
       $("#updatePassword_newPassword").blur(function () {
           var password = $(this).val();
           var pattend = /^[a-zA-Z]+[a-zA-Z0-9]{5,15}$/;
           if (pattend.test(password)){
               $("#errnewPassword").html(" √ ");
               $("#errnewPassword").css("color","green");
           }else{
               $("#errnewPassword").html("× 密码必须6~16位，包含字母和数字");
               $("#errnewPassword").css("color","red");
           }
           if ($("#updatePassword_confirmPassword").val().trim()!= ""){
               verify();
           }
       });

       //confirmPassword
        $("#updatePassword_confirmPassword").blur(function () {
            verify();
        });

    });
    function verify () {
        var pass = $("#updatePassword_newPassword").val();
        var conpass = $("#updatePassword_confirmPassword").val().trim();
        if(pass == conpass && conpass != ""){
            $("#errconfirmPassword").html(" √ ");
            $("#errconfirmPassword").css("color","green");
        }else{
            $("#errconfirmPassword").html("× 与密码不一致");
            $("#errconfirmPassword").css("color","red");
        }
    }
</script>
<!--头部 start..-->
<div class="header">


    <div class="top">
        <div class="top_left">
            <span class="f1">欢迎您：${user.username}</span>
        </div>
        <div class="top_right">
            <a href="${path}/user/index" class="top_ico0">首页</a>
            <a href="${path}/user/changepassword" class="top_ico1">修改密码</a>
            <a href="${path}/user/information" class="top_ico2">个人信息</a>
            <a href="${path}/user/exit" class="top_ico3">退出</a>
        </div>
    </div>
    <div class="top2">
        <p class="pro_id">客户关系管理系统 v2.0</p>
    </div>
</div>
<!--head end...-->

<!--主体-->
<table class="main" border="0"
       style="width: 100%; background-color: #FFFFFF">
    <tr>
        <td width="140" style="vertical-align: top;">
            <div class="main_left">


                <div class="sidebar">
                    <h2 id="menu1" class="menuTitle">客户管理</h2>

                    <div class="menu_ul_div" id="menu_ul_div_1" style="display:block;height: 170px;">
                        <ul id="menu1_ul" class="menu_ul">
                            <li class="menuItem"><a href="/crm/customer/initConflict.do">客户冲突</a></li>
                            <li class="menuItem"><a href="/crm/customer/initAdd.do">添加客户</a></li>
                            <li class="menuItem"><a href="/crm/customer/initServe.do">服务中签约客户</a></li>
                            <li class="menuItem"><a href="/crm/customer/initNoServe.do">未签约客户</a></li>
                            <li class="menuItem"><a href="/crm/customer/getAllSea.do">公海客户</a></li>
                            <li class="menuItem"><a href="/crm/visitRecord/initSearch.do">拜访查询</a></li>
                        </ul>
                    </div>
                    <h2 id="menu2" class="menuTitle">合同管理</h2>

                    <div class="menu_ul_div" id="menu_ul_div_2" style="display:block;height: 170px;">
                        <ul id="menu2_ul" class="menu_ul">
                            <li class="menuItem"><a id="anchorContractTemplate" href="/crm/contract/template/list.do">合同模板</a>
                            </li>
                            <li class="menuItem"><a href="/crm/contract/initAdd.do">新增合同</a></li>
                            <li class="menuItem"><a href="/crm/contract/initContractValid.do">有效合同查询</a></li>
                            <li class="menuItem"><a href="/crm/contract/initContractInvalid.do">无效合同查询</a></li>
                            <li class="menuItem"><a href="/crm/contract/initPaymentReceivable.do">应收款查询</a></li>
                            <li class="menuItem"><a href="/crm/payment/initPaymentReceived.do">到款查询</a></li>
                        </ul>
                    </div>
                    <h2 id="menu3" class="menuTitle">报表管理</h2>

                    <div class="menu_ul_div" id="menu_ul_div_3" style="display:block;height: 40px;">
                        <ul id="menu3_ul" class="menu_ul">
                            <li class="menuItem"><a href="/crm/record/initReport.do">拜访量报表</a></li>
                        </ul>
                    </div>

                    <h2 id="menu4" class="menuTitle">系统设置</h2>

                    <div class="menu_ul_div" id="menu_ul_div_4" style="display:block;height: 130px;">
                        <ul id="menu4_ul" class="menu_ul">
                            <li class="menuItem"><a href="/crm/system/search.do">员工设置</a></li>
                            <li class="menuItem"><a href="/crm/announcement/search.do">公告管理</a></li>
                            <li class="menuItem"><a href="/crm/system/picture.do">首页图片设置</a></li>
                            <li class="menuItem"><a href="/crm/syslog/searchSyslog.do">系统日志</a></li>
                            <li class="menuItem"><a href="/crm/system/else.do">其他设置</a></li>
                            <li class="menuItem"><a href="/crm/system/tree.do">jstree3-部门树</a></li>
                        </ul>
                    </div>
                </div>


            </div>
        </td>
        <td style="vertical-align: top;">
            <div class="main_right">
                <link rel="stylesheet" href="/crm/css/themes/base/jquery.ui.all.css">
                <script src="/crm/js/jquery-1.7.2.js"></script>
                <script src="/crm/js/jquery.ui.core.js"></script>
                <script src="/crm/js/jquery.ui.widget.js"></script>
                <script src="/crm/js/jquery.ui.button.js"></script>
                <link rel="stylesheet" href="/crm/css/demos.css">

                <link rel="stylesheet" href="/crm/css/icons.css">

                <script src="/crm/js/icons.js"></script>
                <!-- 中部DIV -->
                <div class="main">
                    <div class="content">
                        <div class="pageHead">
                            <table>
                                <tr>
                                    <th width="8">
                                        <img src="/crm/images/c_l.gif" height="31" width="8"/>
                                    </th>
                                    <th align="left" class="title_area">
                                        当前位置：系统设置 &gt; 修改密码
                                    </th>
                                    <th width="9">
                                        <img src="/crm/images/c_r.gif" height="31" width="9">
                                    </th>
                                </tr>
                            </table>
                        </div>
                        <div class="pageBody">
                            <form id="updatePassword" name="updatePassword" action="${path}/user/changsavepassword"
                                  method="post">
                                <table class="mytable resultTable">
                                    <tr>
                                        <td>
                                            输入原密码：
                                        </td>
                                        <td>
                                            <input type="password" name="password" id="updatePassword_null"
                                                   style="display:none;"/>
                                            <input type="password" name="oldPassword"
                                                   id="updatePassword_oldPassword"
                                                   value=""/>
                                        </td>
                                        <td class="errorMessage" id="erroldPassword"></td>
                                    </tr>
                                    <tr>
                                        <td>
                                            输入新的密码：
                                        </td>
                                        <td>
                                            <input type="password" name="newPassword"
                                                   id="updatePassword_newPassword" required/>
                                        </td>
                                        <td class="errorMessage" id = "errnewPassword"></td>
                                    </tr>
                                    <tr>
                                        <td>
                                            确认新的密码：
                                        </td>
                                        <td>
                                            <input type="password" name="confirmPassword"
                                                   id="updatePassword_confirmPassword" required/>
                                        </td>
                                        <td class="errorMessage" id="errconfirmPassword"></td>
                                    </tr>

                                </table>
                                <div class="buttonBar">
                                    <button id="btnSave" type="submit">确认</button>
                                    <button id="btnBack" onclick="javascript:location='${path}/user/index'">返回
                                    </button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>
        </td>
    </tr>
</table>

<!--主体 end-->


<!--尾部-->
<div class="footer">
    <div class="seperator"></div>
    <p>
        <a href="http://www.sztzedu.com">公司主站</a>|
        <a href="#">隐私策略</a>|
        <a href="#">服务条款</a>&nbsp;
        苏州天智教育公司&reg;版权所有 2012-2015
    </p>
</div>
<!--尾部 end..-->

</body>
</html>

